## public
cmake_minimum_required(VERSION 2.6)

project(node)

include_directories(
    ${PROJECT_SOURCE_DIR}
)

set(node_SRC
    macros.h
    exception.h
    exception.cc
    sys/console.h
    sys/thread.h
    sys/thread_pool.h
    sys/thread_pool.cc
    sys/mutex.h
    sys/event.h
    sys/lock_guard.h
    
    fs/file.h
    fs/filesystem.h
    fs/filesystem.cc
    
    util/string.h
    util/string.cc
    util/profiler.h
    util/bytebuffer_exception.h
    util/bytebuffer_exception.cc
    util/bytebuffer.h
    util/bytebuffer.cc
    util/local_bytebuffer.h
    util/xmlfile.h
    util/xmlfile.cc
    util/inifile.h
    util/inifile.cc
    util/log.h
    util/log.cc
    util/time.h
    util/random.h
    util/random.cc
    util/byte_converter.h
    
    crypto/bignumber.h
    crypto/bignumber.cc
    crypto/sha1.h
    crypto/sha1.cc
    crypto/hmac.h
    crypto/hmac.cc
    
    db/rdb/field.h
    db/rdb/field.cc
    db/rdb/resultset.h
    db/rdb/resultset.cc
    db/rdb/connection.h
    db/rdb/connection.cc
    db/rdb/database.h
    db/rdb/database.cc
    db/rdb/details/mysql_resultset.h
    db/rdb/details/mysql_resultset.cc
    db/rdb/details/mysql_connection.h
    db/rdb/details/mysql_connection.cc
    db/rdb/details/mysql_database.h
    db/rdb/details/mysql_database.cc
    
    net/http/http_request.h
    net/http/http_request.cc
    net/http/http_response.h
    net/http/http_response.cc
    net/http/http_server.h
    net/http/http_server.cc
    net/http/http_worker.h
    net/http/http_worker.cc
    net/tcp/socket.h
    net/tcp/socket.cc
    net/tcp/server_socket.h
    net/tcp/server_socket.cc
    net/tcp/socket_factory.h
    net/tcp/tcp_server.h
    net/tcp/tcp_server.cc
    net/tcp/tcp_worker.h
    net/tcp/tcp_worker.cc
    
    app/application.h
    app/application.cc
    app/option.h
    app/option.cc
    app/option_set.h
    app/option_set.cc
    app/subsystem.h
)

if (WIN32)
set(plat_SRC
    sys/details/console_win.h
    sys/details/console_win.cc
    sys/details/thread_win.h
    sys/details/thread_win.cc
    sys/details/mutex_win.h
    sys/details/event_win.h
    
    fs/details/file_win.h
    fs/details/file_win.cc
    
    util/details/string_win.cc
    util/details/profiler_win.h
    util/details/profiler_win.cc
    util/details/time_win.cc
)
else()
endif()

add_library(node STATIC ${node_SRC} ${plat_SRC})